//
//  AboutWeViewController.m
//  LOL_PalmarHelper
//
//  Created by dllo on 15/6/19.
//  Copyright (c) 2015年 hantao. All rights reserved.
//

#import "AboutWeViewController.h"

@interface AboutWeViewController ()

@end

@implementation AboutWeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar1.png"] forBarMetrics:UIBarMetricsDefault];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(leftButton)];
    self.navigationItem.title = @"About We";
    
    
    
    UIScrollView *myScroll = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    myScroll.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.view addSubview:myScroll];
    [myScroll release];
    
    
    
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.bounds.size.width - 150) / 2, self.view.bounds.size.height / 7, 150, 150)];
    
    
    
    
        imageV.image = [UIImage imageNamed:@"lolLOGO.png"];
        
    
       [myScroll addSubview:imageV];
        [imageV release];
    
    
    UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, imageV.frame.origin.y + imageV.frame.size.height + 50, self.view.bounds.size.width, 2)];
    lineLabel.backgroundColor = [UIColor blackColor];
    [myScroll addSubview:lineLabel];

    
    
    
    
    
    
    UILabel *belowLine = [[UILabel alloc] initWithFrame:CGRectMake(lineLabel.frame.origin.x, lineLabel.frame.origin.y + 52, (lineLabel.frame.size.width - 163) / 2, lineLabel.frame.size.height - 1)];
    belowLine.backgroundColor = [UIColor blackColor];
    [myScroll addSubview:belowLine];
    [belowLine release];
    
    UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(belowLine.frame.size.width, lineLabel.frame.origin.y + 32, 163, 40)];
    textLabel.backgroundColor = [UIColor clearColor];
    textLabel.text = @" HHZ Team 倾力打造";
    [myScroll addSubview:textLabel];
    [textLabel release];
    
    UILabel *belowline2 = [[UILabel alloc] initWithFrame:CGRectMake(textLabel.frame.size.width + textLabel.frame.origin.x, belowLine.frame.origin.y, belowLine.frame.size.width, belowLine.frame.size.height)];
    belowline2.backgroundColor = [UIColor blackColor];
    [myScroll addSubview:belowline2];
    [belowline2 release];
    
    
    UILabel *belowAbout = [[UILabel alloc] initWithFrame:CGRectMake(0, textLabel.frame.origin.y + textLabel.frame.size.height + 30, belowLine.frame.size.width, belowLine.frame.size.height)];
    belowAbout.backgroundColor = [UIColor blackColor];
    [myScroll addSubview:belowAbout];
    [belowAbout release];
    
    
    UILabel *aboutWe = [[UILabel alloc] initWithFrame:CGRectMake(textLabel.frame.origin.x, belowAbout.frame.origin.y - 20, textLabel.frame.size.width, textLabel.frame.size.height)];
    aboutWe.text = @"关于 HHZ Team";
    aboutWe.backgroundColor = [UIColor clearColor];
    aboutWe.textAlignment = NSTextAlignmentCenter;
    [myScroll addSubview:aboutWe];
    [aboutWe release];
    
    UILabel *belowAbout1 = [[UILabel alloc] initWithFrame:CGRectMake(belowline2.frame.origin.x, belowAbout.frame.origin.y, belowline2.frame.size.width, belowline2.frame.size.height)];
    belowAbout1.backgroundColor = [UIColor blackColor];
    [myScroll addSubview:belowAbout1];
    [belowAbout1 release];
    
    
    UILabel *aboutOurTeam = [[UILabel alloc] initWithFrame:CGRectMake(5, aboutWe.frame.origin.y + aboutWe.frame.size.height , self.view.frame.size.width - 10, 80)];
    aboutOurTeam.backgroundColor = [UIColor clearColor];
    
    aboutOurTeam.text = @"HHZ Team 创建于2014年。此款软件由Leader韩涛,deputy Leader韩啸,deputy Leader 周家稳共同开发;共耗时十五个工作日,如果您对此软件或者是我们有什么好的建议,请联系我们（QQ：759259001，1046357772，806396487）。";
    aboutOurTeam.numberOfLines = 0;
    aboutOurTeam.font = [UIFont systemFontOfSize:16];
    [myScroll addSubview:aboutOurTeam];
    [aboutOurTeam release];
   CGFloat height = [self heightOfMe:aboutOurTeam.text];
    
    CGRect frame = aboutOurTeam.frame;
    frame.size.height = height;
    aboutOurTeam.frame = frame;
    
    
    myScroll.contentSize = CGSizeMake(0, aboutOurTeam.frame.origin.y + aboutOurTeam.frame.size.height + 130);
    
    
    
    
    
   }






-(void)dealloc
{

    [_adressLabel release];
    [super dealloc];


}


-(CGFloat)heightOfMe:(NSString *)text
{
    
    CGSize size = CGSizeMake(self.view.frame.size.width - 10, 10000);
    NSDictionary *dic = [NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:16] forKey:NSFontAttributeName];
    CGRect frame = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];;
    
    return frame.size.height;
    
    
}





-(void)leftButton
{

[self dismissViewControllerAnimated:YES completion:^{
    
    
}];


}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
